package pl.nith.battleships.managers;

import pl.nith.battleships.models.Board;

public class GameStateManager
{
	public static enum GameState
	{
		GAME_NOT_STARTED,
		SERVER_STARTED,
		CONNECTED,
		SETTING_SHIPS,
		WAITING,
		PLAYING
	}
	
	public static enum Turn
	{
		MY_TURN,
		ENEMY_TURN,
		NONE
	}
	
	public boolean ENEMY_READY = false;
	
	public GameState currentGameState = GameState.GAME_NOT_STARTED;
	public Turn turn = Turn.NONE;
	
	public void setFirstTurn()
	{
		if (Manager.getServer().isServerRunning)
			turn = Turn.MY_TURN;
		
		else if (Manager.getClient().isClientConnected)
			turn = Turn.ENEMY_TURN;
	}
	
	private Board board;
	public Board getBoard()
	{
		return board;
	}
	
	public GameStateManager()
	{
		if (board == null)
			board = new Board();
	}
}
